﻿@using SmartStore.Rules
@model IRuleExpression
@{
    var id = string.Concat("rule-value-", Model.Id);
    var value = Model.Value as bool?;

    var listItems = new List<SelectListItem>
    {
        new SelectListItem { Text = T("Common.Yes").ToString(), Value = "true", Selected = value.HasValue && value.Value },
        new SelectListItem { Text = T("Common.No").ToString(), Value = "false", Selected = value.HasValue && !value.Value }
    };

    if (Model.Descriptor.RuleType.ClrType == typeof(bool?))
    {
        listItems.Insert(0, new SelectListItem { Text = T("Common.Unspecified").ToString(), Value = string.Empty, Selected = !value.HasValue });
    }
}
@Html.DropDownList(id, listItems, new { @class = "form-control list-box" })
<script>
    $(function () {
        $('#@id').selectWrapper();
	});
</script>
